package org.feng.manage.sys;

import java.util.HashMap;
import java.util.Map;

/**
 * 操作处理器工厂
 *
 * @author feng
 */
public class OperateHandlerFactory {

    private static final Map<OperateEnum, AbstractOperateHandlerTemplate<?, ?>> OPERATE_HANDLER_TEMPLATE_MAP = new HashMap<>(16);


    public static void register(OperateEnum operate, AbstractOperateHandlerTemplate<?, ?> orderHandler) {
        OPERATE_HANDLER_TEMPLATE_MAP.put(operate, orderHandler);
    }

    public static AbstractOperateHandlerTemplate<?, ?> getOperateHandler(OperateEnum operate) {
        return OPERATE_HANDLER_TEMPLATE_MAP.get(operate);
    }
}
